<template>
  <el-input
    v-bind="controlProps"
    :model-value="modelValue"
    v-on="pureListeners"
    @update:modelValue="inputHandle"
  />
</template>

<script setup>
import { Search } from "@element-plus/icons-vue";
import { usePureListenersAndAttr } from "@/utils";
const { pureAttrs, pureListeners } = usePureListenersAndAttr();

const { events, modelValue } = defineProps(["modelValue"]);
const emits = defineEmits(["update:modelValue"]);
const controlProps = computed(() => ({
  suffixIcon: Search,
  clearable: true,
  ...pureAttrs,
}));
const inputHandle = (value) => {
  if (!events?.["update:modelValue"]) {
    emits("update:modelValue", value);
  }
};
</script>
